<template>
    <div class="top">
        <h3 class="new">
            {{newlist.title}}
        </h3>
        <p class="shujian">
            <span>发表时间:{{newlist.add_time}}</span>
            <span>点击{{newlist.click}}次</span>
        </p>
        <hr>
        <div class="conter" v-html="newlist.content">
        </div>  
        <comment-box :id="this.id">

        </comment-box>
    </div>
</template>

<script>
import comment from '../subcomponents/comment.vue';
import {Toast} from 'mint-ui';
export default{
    data(){
        return{
            id:this.$route.params.id,
            newlist:{}
        }
    },
    created(){
     this.getnew();
    },
    methods:{
        getnew(){
        this.$http.get('../../data/newlist.json').then(result=>{
            if(result.body.status===0){
                this.newlist = result.body.message[0]; 
            }else{
                Toast("获取失败！")
            }
        })
    }
    },
    components:{
        "comment-box":comment
    }
}
</script>
<style lang="sass" scoped>
.top{
     .new{
         font-size:16px;
         color:red;
         text-align:center;
         padding:5px 0px;
     }
     .shujian{
         font-size:13px;
          color:blue;
          display:flex;
          justify-content:space-between;
     }
     .conter{}
}
</style>